﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Index_CreatePerson : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        

    }
    protected void BtSubmit_Click(object sender, EventArgs e)
    {
        MembershipUser user = Membership.GetUser();
        string id = user.ProviderUserKey.ToString();

        PartyFinderDBDataContext db = new PartyFinderDBDataContext();
        aspnet_User users = db.aspnet_Users.SingleOrDefault(x => x.UserId.Equals(id));
        users.Name = TxtName.Text;
        users.LastName = TxtLastName.Text;
        users.BirthYear = Convert.ToInt32(TxtBirthyear.Text);
        users.TelephoneNumber = Convert.ToInt32(TxtTelephoneNumber.Text);
        users.PictureDir = "None.png";
        db.SubmitChanges();
        Response.Redirect("HomePage.aspx");
    }
}